package com.qf.pojo;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * @author 高圆圆
 * @date 2023/4/25 11:11
 * 订单实体
 */
public class Order {
    /**
     *
     oid varchar(32) NOT NULL
     ordertime datetime NULL
     total double NULL
     state int(11) NULL
     address varchar(30) NULL
     name varchar(20) NULL
     telephone varchar(20) NULL
     uid varchar(32) NULL
     */

    private String oid ; //订单编号
    private Date ordertime ;//下订单时间
    private double total   ; //总金额
    private int   state    ; //订单状态,默认值0,未支付,1,表示已支付
    private String address ; //订单收货地址
    private String name    ; //收货人
    private String telephone ; //电话
    private User user ; //订单属于的用户实体

    public Order() {
    }

    //这个订单包含很多订单项
    private List<OrderItem> list = new LinkedList<>() ;

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public Date getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(Date ordertime) {
        this.ordertime = ordertime;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<OrderItem> getList() {
        return list;
    }

    public void setList(List<OrderItem> list) {
        this.list = list;
    }

    //JavaBean实体规范:具体类/属性私有化/对外提供setXXX()/getXXX()


   /* @Override
    public String toString() {
        return "Order{" +
                "oid='" + oid + '\'' +
                ", ordertime=" + ordertime +
                ", total=" + total +
                ", state=" + state +
                ", address='" + address + '\'' +
                ", name='" + name + '\'' +
                ", telephone='" + telephone + '\'' +
                ", user=" + user +
                ", list=" + list +
                '}';
    }*/
}
